< previous page page_713 next page >

Page 713
Table A.1 Options to Set in Your Visual Basic Environment.
Editor Tab
OptionValueDescription
Tab Stops3Can be anything you want. I prefer 3.
Require Variable DeclarationCheckedRequires you to declare all variables prior to usage by adding an Option Explicit statement to the beginning of every module.
General Tab
OptionValueDescription
Grid Units, Height Points60Can be anything but should be a multiple of 300 because thats the minimum height of a combo box. You should strive to make all controls a consistent size, and 300 is a good default height.
Grid Units, Width Points60(See preceding description.)
Environment Tab
OptionValueDescription
When a Program Starts. . .Prompt to Save ChangesCheckedPrompts you to save changes prior to testing the application. This is done to ensure no work is lost due to general protection faults (GPF) or other unexpected errors.

Option Explicit
Declaring all variables in your code saves programming time by reducing the number of bugs caused by typos and undeclared variables. For example, the following variables all look the same: aUserNameTmp, sUserNameTmp, and sUserNameTemp. If you dont set the Option Explicit statement at the top of every module, these different variable names could all have potentially different values. At runtime, you check the value of the sUserNameTmp variable when you really wanted to be checking the value of the variable sUserNameTemp. If you set the Option Explicit statement at the top of the module, the compiler will inform you of the typo. If you dont set the Option Explicit, the runtime engine will simply create another variable on-the-fly and assign a zero value to that variable. This can lead to a bug thats very hard to track down.

 
< previous page page_713 next page >

If you like this book, buy it!